var app=angular.module("myapp", [])

app.controller("myCtrl" ,function($scope,userService){
	
	
	//注册
	$scope.onClickregister=function(){
		userService.register($scope.username,$scope.pwd1,$scope.email,$scope.phonenumber).then(
				function successCallback(response) {
					
					if("Y"==response.data.rs){
						window.location.href="/test/login.html";
						
					}else if("N"==response.data.rs){
						$scope.msg="用戶名已存在";
						$("#myModal").modal('show');
						
					}
			
			}, function errorCallback(response) {
				// 请求失败执行代码
			});
		
		
		
	}
		
	
	
	
	
	
	
})